function cball(form,c) 
{ 
	for (var i=0;i<form.elements.length;i++) 
	{ 
	var e = form.elements[i];

	if ((e.Name != "allcheckbox"&&e.Name != "allcheckbox1")&&e.disabled==false) 
		{
			e.checked = c; 
		}
	} 
} 


function check(str,t_url)
{
	if (str=='list' || str=='sys_list')
	{
		document.form.doact.value=str
		document.form.submit()
		return
	}
	var inp=document.getElementsByTagName('input')
	var count=0
	document.form.hid.value=0;
	for(i=0;i<inp.length;i++)
	{
		if(inp[i].type=="checkbox")
		{
			if(inp[i].checked)
			{
			   count++;
			   if(inp[i].value!='on')
			   {
			   	document.form.hid.value=document.form.hid.value+","+inp[i].value;
			   }
			}
		}
		
	}
	if(count==0) {
	    alert("Please select the records！")
		return false
		}
	else if (count>0) 
	{
		var confirmit=confirm("Are you sure to delete records?")
		
		if(confirmit)
		{    
			document.form.submit()
		}
		else {
		alert("count Error");		
		return false;
		}
	}
}


function comfim(url)
{
	if(confirm("确认此次数据操作？"))
	{
		var uiUrl = '../mainframe/main.jsp';
		var method = "POST";
		var vars	= url;
		//alert(vars);
		//return false;
		var cb = function(xhq) {
				document.getElementById("body").innerHTML = xhq.responseText;
		}
		var xhconn = new XHConn();
		xhconn.connectAsync(uiUrl, method, vars, cb);
	}
}


NS4 = (document.layers) ? 1 : 0; 

IE4 = (document.all) ? 1 : 0; 

ver4 = (NS4 || IE4) ? 1 : 0; 



if (ver4) { 

with (document) { 

write("<STYLE TYPE='text/css'>"); 

if (NS4) { 

write(".parent {position:absolute; visibility:visible}"); 

write(".child {position:absolute; visibility:visible}"); 

write(".regular {position:absolute; visibility:visible}") 

} 

else { 

write(".child {display:none}") 

} 

write("</STYLE>"); 

} 

} 



function getIndex(el) { 

ind = null; 

for (i=0; i<document.layers.length; i++) { 

whichEl = document.layers[i]; 

if (whichEl.id == el) { 

ind = i; 

break; 

} 

} 

return ind; 

} 



function arrange() { 

nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height; 

for (i=firstInd+1; i<document.layers.length; i++) { 

whichEl = document.layers[i]; 

if (whichEl.visibility != "hide") { 

whichEl.pageY = nextY; 

nextY += whichEl.document.height; 

} 

} 

} 



function initIt(){ 

if (!ver4) return; 

if (NS4) { 

for (i=0; i<document.layers.length; i++) { 

whichEl = document.layers[i]; 

if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide"; 

} 

arrange(); 

} 

else { 

divColl = document.all.tags("DIV"); 

for (i=0; i<divColl.length; i++) { 

whichEl = divColl(i); 

if (whichEl.className == "child") whichEl.style.display = "none"; 

} 

} 

} 



function expandIt(el) { 

if (!ver4) return; 

if (IE4) { 

whichEl = eval(el + "Child"); 

if (whichEl.style.display == "none") { 

whichEl.style.display = "block"; 

} 

else { 

whichEl.style.display = "none"; 

} 

} 

else { 

whichEl = eval("document." + el + "Child"); 

if (whichEl.visibility == "hide") { 

whichEl.visibility = "show"; 

} 

else { 

whichEl.visibility = "hide"; 

} 

arrange(); 

} 

} 

onload = initIt; 



//选中所有人

function checkall(){

var objs = document.getElementsByTagName("input");

	for(var i=0;i<objs.length;i++)

	{

		//if(objs[i].type.toLowerCase()=="checkbox")

		//{

         objs[i].checked=true;

		//}

	}

}



//取消选中所有人

function uncheckall(){

var objs = document.getElementsByTagName("input");

	for(var i=0;i<objs.length;i++)

	{

		//if(objs[i].type.toLowerCase()=="checkbox")

		//{

         objs[i].checked=false;

		//}

	}

	

}



//选中本组所有人

function selectSubCheckbox(frm,cb,pname)

{

	//alert(pname+" "+pmobile);

	var arrPname,i,j;

	arrPname=pname;

	var objs = document.getElementsByName(arrPname);

	for(j=0;j<objs.length;j++)

	{

		//if(objs[j].type=="checkbox" && objs[j].id==arrPname)

		//{

			objs[j].checked=cb.checked;

		//}

	}

}

function $(_s){
	return document.getElementById(_s);
}
function pass_value(inputName,str){
	if($(inputName).value.indexOf(str)<0){
		$(inputName).value+=str+",";
	}
}
function ajax_friend(str)
{
	var uiUrl = '/app/public_ajax/friend.jsp';
	var method = "POST";
	var vars = "accepter_id="+str+"&rdm=" + new Date().getTime();

	var cb = function(xhq) {
			sAlert(xhq.responseText);
	}

	var xhconn = new XHConn();
	xhconn.connectAsync(uiUrl, method, vars, cb);

}
